package org.lgiavedoni.android.franq.command.system;

import org.apache.commons.cli.CommandLine;
import org.lgiavedoni.android.franq.core.command.Command;
import org.lgiavedoni.android.franq.service.communication.CommunicationService;

public class EchoCommand extends Command {

	@Override
	public boolean execute(CommandLine cmd) throws Exception {

		StringBuffer value = new StringBuffer();
		for (int i = 0; i < cmd.getArgList().size(); i++) {
			value.append(" " + cmd.getArgList().get(i));
		}
		CommunicationService.inst.sendDefaultTextMessage(value.toString());
		return true;
	}

	@Override
	public String getCommandText() {
		return "echo";
	}
}